package com.example.shushiyunsst.util

import java.lang.reflect.ParameterizedType
import java.lang.reflect.Type

fun hookGenericSuperClass(clazz: Class<*>): Type? {
    val genericSuperclass = clazz.genericSuperclass
    return if (genericSuperclass is ParameterizedType) {
        genericSuperclass.actualTypeArguments[0]
    } else {
        clazz
    }
}